<template>
  <div>
      添加图片：<input type="text" v-model="bb.tupian"><br>
      添加地址：<input type="text" v-model="bb.dizhi"><br>
      添加类型：<input type="text" v-model="bb.leixing">
      <button @click="qq">确认添加</button>
      <table border="1">
          <tr>
              <td>id</td>
              <td>图片</td>
              <td>地址</td>
              <td>类型</td>
          </tr>
          <tr v-for="i in aa">
              <td>{{i.id}}</td>
              <td>{{i.tupian}}</td>
              <td>{{i.dizhi}}</td>
              <td>{{i.leixing}}</td>
          </tr>
      </table>
  </div>
</template>

<script>
export default {
    name:'bbb',
    data(){
        return{
            aa:[],
            bb:{
                tupian:"",
                dizhi:"",
                leixing:""

            }
        }
    },
    mounted(){
        this.gen()
    },
    methods:{
        gen(){
            this.$axios.get(`bb/`).then(item=>{
                this.aa = item.data
            })
        },
        qq(){
            this.$axios.post(`bb/`,this.bb).then(item=>{
                alert('添加成功')
            })
        }
    }
}
</script>

<style>

</style>